/*! \file AppFactory.h
 *	\brief <write description for AppFactory.h>
 *
 *	created:	2010/02/13
 *	created:	13:2:2010   17:45
 *	filename: 	c:\src\gag-engine\libs\app\AppFactory.h
 *	file path:	c:\src\gag-engine\libs\app
 *	file base:	AppFactory
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#ifndef _APP_APPFACTORY_H_
#define _APP_APPFACTORY_H_

#pragma once

#include <core/SmartPtr.h>
#include <utils/Singleton.h>

namespace tt{
namespace app{

class Window;

class AppFactory : public utils::Singleton<AppFactory>
{
public:
	AppFactory();
	virtual ~AppFactory();

	virtual SharedPtr<Window> createWindow() = 0;

protected:
	template<typename ConcreteWindow, typename ConcreteWindowImpl>
	SharedPtr<ConcreteWindow> doCreateWindow(ScopedPtr<ConcreteWindowImpl>&);
};

} //namespace app

TT_SINGLETON_GET_FUNCTION(app::AppFactory, ttAppFactory);

} //namespace tt
#include "AppFactory.inl"

#endif //_APP_APPFACTORY_H_